<template>
  <div class="hello">
    <h1>{{ msg }}</h1>
    <h2>Essential Links</h2>
    <div>
      <h2>Essential Links1</h2>
    </div>
    <div>
      <span> {{ childValue }} </span>
      <span> {{ inputMsg }} </span>
      <input type='button' value='CLICKHERE' @click='childClick'>
    </div>
  </div>
</template>

<script>
import Bus from '@/components/Bus.js'
export default {
  name: 'HelloWorld',
  data () {
    return {
      msg: 'Welcome to Your Vue.js App',
      childValue: '9999'
    }
  },
  props: {
    inputMsg: String,
    required: true
  },
  methods: {
    childClick: function () {
      console.log('begin emit...')
      this.$emit('passChildValue', this.childValue)
      Bus.$emit('val', this.childValue)
    }
  }
}
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
h1, h2 {
  font-weight: normal;
}
ul {
  list-style-type: none;
  padding: 0;
}
li {
  display: inline-block;
  margin: 0 10px;
}
a {
  color: #42b983;
}
</style>
